﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;

namespace LogisticsWebApp.anonymity
{
    public partial class EnterpriseRegister : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void register_Click(object sender, EventArgs e)
        {
            EnterpriseUser user = new EnterpriseUser
            {
                Id = this.id.Text,
                Password = this.password.Text,
                CompanyType = this.companyType.Text,
                CompanyName = this.companyName.Text,
                RegisterLocation = this.country.SelectedValue + this.province.SelectedValue + this.city.SelectedValue,
                BusinessLocation = this.businessLocation.Text,
                Industry = this.industry.SelectedValue,
                Business = this.business.SelectedValue,
                Email = this.email.Text,
                FixPhone = this.fixPhone.Text,
                Fax = this.fax.Text,
                Contact1 = this.contact1.Text,
                Contact2 = this.contact2.Text,
                Contact3 = this.contact3.Text,
                ReceiveMsg = this.ReceiveMsg.Checked
            };

            EnterpriseUserDataAccess userDA = new EnterpriseUserDataAccess();
            userDA.CreateUser(user);

            Server.Transfer(string.Format("registerresult.aspx?userid={0}",this.id.Text));

        }
    }
}
